#@head() 
#@header() 

#@aside("user")
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
	<!-- Main content -->
	<section class="content">
		<div class="row">
			<!-- right column -->
			<div class="col-md-12">
				<!-- Horizontal Form -->
				<div class="box box-info">
					<div class="box-header with-border">
						<h3 class="box-title">创建用户</h3>
					</div>
					<!-- /.box-header -->
					<!-- form start -->
					<div class="form-horizontal">
						<div class="box-body">
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">手机号码</label>
								<div class="col-sm-8">
									<input type="text" id="phone" name="ticket.phone"
										class="form-control"  value="#(item.phone??)" />
								</div>
							</div>
						</div>
						<div class="box-header with-border">
							<h3 class="box-title">开户信息</h3>
						</div>
						<div class="box-body">
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">真实姓名</label>
								<div class="col-sm-8">
									<input type="text" id="phone" name="ticket.phone"
										class="form-control"  value="#(item.phone??)" />
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">身份证号码</label>
								<div class="col-sm-8">
									<input type="text" id="phone" name="ticket.phone"
										class="form-control"  value="#(item.phone??)" />
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">邮箱</label>
								<div class="col-sm-8">
									<input type="text" id="phone" name="ticket.phone"
										class="form-control"  value="#(item.phone??)" />
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">开户行</label>
								<div class="col-sm-8">
									<input type="text" id="phone" name="ticket.phone"
										class="form-control"  value="#(item.phone??)" />
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">银行卡</label>
								<div class="col-sm-8">
									<input type="text" id="phone" name="ticket.phone"
										class="form-control"  value="#(item.phone??)" />
								</div>
							</div>
						</div>
						<!-- /.box-body -->
						<div class="box-footer">
							<button type="submit" class="btn btn-info center-block">提交</button>
						</div>
						<!-- /.box-footer -->
					</div>
				</div>
				<!-- /.box -->
			</div>
			<!--/.col (right) -->
		</div>
		<!-- /.row -->
	</section>
	<!-- /.content -->
</div>
<!-- /.content-wrapper -->
#@footer()
#@foot()
<script>
$(function(){ 
 		$("#clientid").on('change keyup',function(){
 			ajax("#(path)/client/findById",{"id":$("#clientid").val()},function(data){
 				 
                 $('#phone').empty();
                 $('#phone').val(data.phone);
 			});
 		});  
  		
       $("#clientid").select2({
               ajax: {
                   url: "#(path)/client/search",
                   dataType: 'json',
                   delay: 250,
                   data: function(params) {
                       return {
                           key: params.term
                       };
                   },
                   processResults: function(data, params) {
                       
                       return {
                           results: data
                       };
                   },
                   cache: true
               },
               minimumInputLength: 1
        });
      
       $(".user").select2({
              ajax: {
                  url: "#(path)/user/search",
                  dataType: 'json',
                  delay: 250,
                  data: function(params) {
                      return {
                          key: params.term
                      };
                  },
                  processResults: function(data, params) {
                      
                      return {
                          results: data
                      };
                  },
                  cache: true
              },
              minimumInputLength: 1
    });
});
</script>
</body>
</html>